Visual Cafe Pro Language Reference Constructor index | Method index | Bottom

Class: symantec.itools.db.pro.RelationView

Purpose Represents a RelationView.
Hierarchy java.lang.Object
|
+----symantec.itools.db.pro.RelationView
Syntax public class RelationView
extends Object
implements DataAccess
Description RelationView implements interface symantec.itools.db.pro.DataAccess. RelationView handles all data manipulation with a dbANYWHERE Server. It lets you bind an object to a projection.

A RelationView is a reference to Record object in MultiView's view. You can have multiple independent RelationView for one view that is in a MultiView.

See also AutoDetail
DataAccess
MultiView

Constructor Index

Constructor index | Method index | Top | Bottom
RelationView
 o Creates a RelationView object.
 o Syntaxes:
RelationView(Request)
RelationView(AutoDetail)

Method Index

Constructor index | Top | Bottom
asciiStreamtoString(InputStream)
 o Returns a String from a java.io.InputStream object that is in ASCII format.
binaryArraytoString(byte)
 o Returns a String from an array of bytes.
binaryStreamtoString(InputStream, int)
 o Returns a String from a java.io.InputStream object that is in binary format.
bindCurrentRecord(RecordLink)
 o Binds a RecordLink object to a RelationView's current record.
bindList
 o Binds a Java object to a RelationView's projection.
 o Syntaxes:
bindList(ConnectionInfo, String, ListLink, Vector)
bindList(ConnectionInfo, String, ListLink, int[ ])
bindProj(int, ProjLink)
 o Binds a Java object to a RelationView's projection.
closeMultiView( )
 o Closes a MultiView.
deleteRecord( )
 o Marks a record for deletion.
doesProjExist(String)
 o Indicates whether or not a specific projection exists.
enableBindingNotify
 o Turns on or off the notification of ProjLink, ListLink, and RecordLink objects.
 o Syntaxes:
enableBindingNotify(boolean)
enableBindingNotify(boolean, boolean)
enableDetailSQL(boolean)
 o Turns on or off the generation of SQL statements for the RelationView's detail views.
findProjByName(String)
 o Returns a projection's ID.
first( )
 o Sets a RelationView's current record to the view's first record.
getAsciiStream
 o Returns a Projection value in a java.io.InputStream object in ASCII format.
 o Syntaxes:
getAsciiStream(int)
getAsciiStream(String)
getAutoDetail
 o Returns an AutoDetail object.
 o Syntaxes:
getAutoDetail( )
getAutoDetail(String)
getAutoDetail(ConnectionInfo, String, Properties, Properties)
getBignum
 o Returns a Projection value as a symjava.lang.Bignum object.
 o Syntaxes:
getBignum(int, int)
getBignum(String, int)
getBinaryStream
 o Returns a Projection value in a java.io.InputStream object in binary format.
 o Syntaxes:
getBinaryStream(int)
getBinaryStream(String)
getBoolean
 o Returns a Projection value as a boolean.
 o Syntaxes:
getBoolean(int)
getBoolean(String)
getByte
 o Returns a Projection value as a byte.
 o Syntaxes:
getByte(int)
getByte(String)
getBytes
 o Returns a Projection value as an array of bytes.
 o Syntaxes:
getBytes(int)
getBytes(String)
getCurrentRecordNumber( )
 o Returns the record number for a RelationView's current record as an int.
getCurrentRecordNumberString( )
 o Returns the record number for a RelationView's current record as a String.
getCurrentRecordState( )
 o Returns the state of a RelationView's current record.
getDate
 o Returns a Projection value as a symjava.sql.Date object.
 o Syntaxes:
getDate(int)
getDate(String)
getDouble
 o Returns Projection value as a double.
 o Syntaxes:
getDouble(int)
getDouble(String)
getFloat
 o Returns Projection value as a float.
 o Syntaxes:
getFloat(int)
getFloat(String)
getInt
 o Returns a Projection value as an int.
 o Syntaxes:
getInt(int)
getInt(String)
getLong
 o Returns a Projection value as a long.
 o Syntaxes:
getLong(int)
getLong(String)
getMetaData( )
 o Returns a RelationViewMetaData object.
getMultiView( )
 o Returns a MultiView.
getName( )
 o Returns a RelationView's name.
getNewRecord( )
 o Creates a new record.
getRecord( )
 o Returns a record.
getShort
 o Returns a Projection value as a short.
 o Syntaxes:
getShort(int)
getShort(String)
getString
 o Returns a Projection value as a String.
 o Syntaxes:
getString(int)
getString(String)
getStringValue
 o Returns a Projection value as a String in ASCII format.
 o Syntaxes:
getStringValue(int)
getStringValue(int, int)
getStringValue(int, boolean)
getStringValue(int, int, boolean)
getStringValue(int, String, int)
getStringValue(int, int, int)
getStringValue(int, String, int, boolean)
getStringValue(int, int, int, boolean)
getTime
 o Returns a Projection value as a symjava.sql.Time object.
 o Syntaxes:
getTime(int)
getTime(String)
getTimestamp
 o Returns a Projection value as a symjava.sql.Timestamp object.
 o Syntaxes:
getTimestamp(int)
getTimestamp(String)
getUnicodeStream
 o Returns a Projection value in a java.io.InputStream object in Unicode format.
 o Syntaxes:
getUnicodeStream(int)
getUnicodeStream(String)
goTo
 o Sets a RelationView's current record to the record with the specified record number.
 o Syntaxes:
goTo(int)
goTo(String)
isBindingNotifyEnabled( )
 o Indicates whether or not binding notifications are enabled.
isCurrentRecordReadable( )
 o Indicates whether or not a record can be read.
isCurrentRecordWritable( )
 o Indicates whether or not a record can be written to.
isNull
 o Indicates whether or not a Projection value is defined.
 o Syntaxes:
isNull(int)
isNull(String)
next( )
 o Sets a RelationView's current record to the next record.
prev( )
 o Sets a RelationView's current record to the previous record.
processEmptyStringData(String, RelationView, int, int, int)
 o Processes an empty or NULL String.
restartMultiView( )
 o Restarts a MultiView.
rewind( )
 o Rewinds a RelationView.
saveMultiView( )
 o Save a MultiView's changes.
setAsciiStream
 o Sets a Projection value to a java.io.InputStream object in ASCII format.
 o Syntaxes:
setAsciiStream(int, InputStream, int)
setAsciiStream(String, InputStream, int)
setBignum
 o Sets a Projection value to a symjava.lang.Bignum value.
 o Syntaxes:
setBignum(int, Bignum)
setBignum(String, Bignum)
setBinaryStream
 o Sets a Projection value to a java.io.InputStream object in binary format.
 o Syntaxes:
setBinaryStream(int, InputStream, int)
setBinaryStream(String, InputStream, int)
setBoolean
 o Sets a Projection value to a boolean value.
 o Syntaxes:
setBoolean(int, boolean)
setBoolean(String, boolean)
setByte
 o Sets a Projection value to a byte value.
 o Syntaxes:
setByte(int, byte)
setByte(String, byte)
setBytes
 o Sets a Projection value to the values in an array of bytes.
 o Syntaxes:
setBytes(int, byte[ ])
setBytes(String, byte[ ])
setDate
 o Sets a Projection value to a symjava.sql.Date value.
 o Syntaxes:
setDate(int, Date)
setDate(String, Date)
setDouble
 o Sets a Projection value to a double value.
 o Syntaxes:
setDouble(int, double)
setDouble(String, double)
setFloat
 o Sets a Projection value to a float value.
 o Syntaxes:
setFloat(int, float)
setFloat(String, float)
setInt
 o Sets a Projection value to an int value.
 o Syntaxes:
setInt(int, int)
setInt(String, int)
setLong
 o Sets a Projection value to a long value.
 o Syntaxes:
setLong(int, long)
setLong(String, long)
setName(String)
 o Sets a RelationView's name.
setNull
 o Sets a Projection value to NULL.
 o Syntaxes:
setNull(int, int)
setNull(String, int)
setShort
 o Sets a Projection value to a short value.
 o Syntaxes:
setShort(int, short)
setShort(String, short)
setString
 o Sets a Projection value to a String value.
 o Syntaxes:
setString(int, String)
setString(String, String)
setTime
 o Sets a Projection value to a symjava.sql.Time value.
 o Syntaxes:
setTime(int, Time)
setTime(String, Time)
setTimestamp
 o Sets a Projection value to a symjava.sql.Timestamp value.
 o Syntaxes:
setTimestamp(int, Timestamp)
setTimestamp(String, Timestamp)
setUnicodeStream
 o Sets a Projection value to a java.io.InputStream object in Unicode format.
 o Syntaxes:
setUnicodeStream(int, InputStream, int)
setUnicodeStream(String, InputStream, int)
setValueFromString
 o Sets a Projection value to a String value.
 o Syntaxes:
setValueFromString(int, String)
setValueFromString(int, String, int)
setValueFromString(int, String, int, int)
setValueFromString(int, String, String, int)
setValueFromString(int, String, String, int, int)
setValueFromString(int, String, int, int, int)
sqlTypeConvert
 o Returns the int or String equivalent of a String or int data type name.
 o Syntaxes:
sqlTypeConvert(String)
sqlTypeConvert(int)
unBindObj(Object)
 o Unbinds an object.
unBindProj(int)
 o Unbinds a projection.
undoRecord( )
 o Undoes a record's data changes.

Constructors

Constructor index | Method index | Top | Bottom

Constructor: RelationView

Purpose Creates a RelationView object.
Syntax public RelationView(Request request) throws SQLException
public RelationView(AutoDetail detail) throws SQLException
Parameters request = Request object.

detail = AutoDetail object.

Description Creates a RelationView object.

Methods

Constructor index | Method index | Top | Bottom

Method: asciiStreamtoString

Purpose Returns a String from a java.io.InputStream object that is in ASCII format.
Syntax public static String asciiStreamtoString(InputStream is) throws IOException
Parameters is = Input stream in ASCII format.
Description Returns a String from a java.io.InputStream object that is in ASCII format.
See also java.io.InputStream (in the Java API Documentation)

Method: binaryArraytoString

Purpose Returns a String from an array of bytes.
Syntax public static String binaryArraytoString(byte b[ ]) throws IOException
Parameters b = Array of bytes.
Description Returns a String from an array of bytes. Zero values are translated to the string "/0". This method should be used for debugging purposes. Returns a String containing the ASCII representation of the data that is stored in the input byte array. The String is limited to 255 characters for performance reasons.

Method: binaryStreamtoString

Purpose Returns a String from a java.io.InputStream object that is in binary format.
Syntax public static String binaryStreamtoString(InputStream is,
int length) throws IOException
Parameters is = Input stream in binary format.

length =

Description Returns a String from a java.io.InputStream object that is in binary format. Zero values are translated to the string "/0". This function is should be used for debugging purposes. Returns a String containing the ASCII representation of the data that is stored in the provided java.io.InputStream. This string is limited to 255 characters, for performance reasons.
See also java.io.InputStream (in the Java API Documentation)

Method: bindCurrentRecord

Purpose Binds a RecordLink object to a RelationView's current record.
Syntax public void bindCurrentRecord(RecordLink obj) throws SQLException
Parameters obj = An object supporting the RecordLink interface.
Description Binds a RecordLink object to a RelationView's current record. Visual CafÄ Pro will notify the RecordLink object each time the current record's data changes.
See also RecordLink
Record

Method: bindList

Purpose Binds a list object to a RelationView's projection.
Syntax public ListBinder bindList(ConnectionInfo conn,
String sql,
ListLink listObj,
Vector columns) throws SQLException
public ListBinder bindList(ConnectionInfo conn,
String sql,
ListLink listObj,
int columns[ ]) throws SQLException
Parameters conn = ConnectionInfo object.

sql = The SQL statement to use when generating the list.

listObj = An object supporting the ListLink interface that wants to be bound to a list of columns.

columns = Columns to bind to the listObj.

Description Binds a Java object to a RelationView's projection. The Java object must support the ListLink interface. This method is only used for objects that support lists.

Returns a ListBinder object.

See also ListLink

Method: bindProj

Purpose Binds a Java object to a RelationView's projection.
Syntax public ProjBinder bindProj(int proj,
ProjLink obj) throws SQLException
Parameters proj = Ordinal number associated with the projection going from left to right in a view.

obj = A Java object that supports the ProjLink interface.

Description Binds a Java object to a RelationView's projection. The Java object must support the ProjLink interface.

Returns a ProjBinder object that can be used to set and get data for the projection.

See also ProjLink

Method: closeMultiView

Purpose Closes a MultiView.
Syntax public void closeMultiView( ) throws SQLException
Parameters None.
Description Closes a MultiView.

Method: deleteRecord

Purpose Marks a record for deletion.
Syntax public void deleteRecord( ) throws SQLException
Parameters None.
Description Marks the RelationView's current record for deletion and notifies the bound ProjLink and ListLink object of the change. The record will be deleted when the MultiView is saved.

Method: doesProjExist

Purpose Indicates whether or not a specific projection exists.
Syntax public boolean doesProjExist(String name) throws SQLException
Parameters name = Project name.
Description Indicates whether or not a specific projection exists.

Method: enableBindingNotify

Purpose Turns on or off the notification of ProjLink, ListLink, and RecordLink objects.
Syntax public void enableBindingNotify(boolean enable) throws SQLException
public void enableBindingNotify(boolean enable,
boolean applyToDetails) throws SQLException
Parameters enable = Indicates whether to enable (True) or disable (False) bound object notifications. When notification is enabled, the caller needs to invoke a notification when one is required.

applyToDetails = Indicates whether or not to apply the enable setting to all detail views that are based on the RelationView.

Description Turns on or off the notification of ProjLink, ListLink, and RecordLink objects when a RelationView's data changes.

Method: enableDetailSQL

Purpose Turns on or off the generation of SQL statements for the RelationView's detail views.
Syntax public void enableDetailSQL(boolean enable) throws SQLException
Parameters enable = Indicates whether to enable (True) or disable (False) the generation of SQL statements.
Description Turns on or off the generation of SQL statements for the RelationView's detail views.

Method: findProjByName

Purpose Returns a projection's ID.
Syntax public int findProjByName(String name) throws SQLException
Parameters name = Name of a projection.
Description Returns a projection's ID. The ID is the ordinal position of the projection relative to the left "side" of the RelationView.

Method: first

Purpose Sets a RelationView's current record to the view's first record.
Syntax public boolean first( ) throws SQLException
Parameters None.
Description Sets a RelationView's current record to the view's first record and notifies all bound ProjLink and ListLink object of the change.

Returns True if a Record object associated with the first Record in the RelationView was found. False, otherwise.

See also ListLink
ProjLink
Record

Method: getAutoDetail

Purpose Returns an AutoDetail object.
Syntax public AutoDetail getAutoDetail( ) throws SQLException
public AutoDetail getAutoDetail(String sql) throws SQLException
public AutoDetail getAutoDetail(ConnectionInfo conn,
String sql,
Properties requestProps,
Properties detailProps) throws SQLException
Parameters sql = SQL statement.

conn = ConnectionInfo object.

requestProps = java.util.Properties object that contains Request properties.

detailProps = java.util.Properties object that contains AutoDetail properties.

Description Returns an AutoDetail object which can be used to add a detail RelationView to this RelationView.

Method: getCurrentRecordNumber

Purpose Returns the record number for a RelationView's current record as an int.
Syntax public int getCurrentRecordNumber( )
Parameters None.
Description Returns the record number for the RelationView's current record.

Method: getCurrentRecordNumberString

Purpose Returns the record number for a RelationView's current record as a String.
Syntax public String getCurrentRecordNumberString( )
Parameters None.
Description Returns the record number for the RelationView's current record.

Method: getCurrentRecordState

Purpose Returns the state of a RelationView's current record.
Syntax public byte getCurrentRecordState( )
Parameters None.
Description Returns the state of the current record. Possible values:
 o RECSTATE_DB_DELETED
 o RECSTATE_DELETED
 o RECSTATE_EXISTING
 o RECSTATE_INVALID
 o RECSTATE_MODIFIED
 o RECSTATE_NEW
 o RECSTATE_NEW_MODIFIED
See also Record

Method: getMultiView

Purpose Returns a MultiView.
Syntax public MultiView getMultiView( ) throws SQLException
Parameters None.
Description Returns a MultiView.

Method: getName

Purpose Returns a RelationView's name.
Syntax public String getName( ) throws SQLException
Parameters None.
Description Returns a RelationView's name.

Method: getNewRecord

Purpose Creates a new record.
Syntax public boolean getNewRecord( ) throws SQLException
Parameters None.
Description Returns the next new record in the view's Record buffers, sets the RelationView's current record to the new record, and notifies all bound ProjLink and ListLink object of the change.

Returns: True indicates that a new Record was positioned in the underlying view that the RelationView represents. False otherwise.

See also ListLink
ProjLink
Record

Method: getRecord

Purpose Returns a record.
Syntax public Record getRecord( ) throws SQLException
Parameters None.
Description Returns a record.

Method: goTo

Purpose Sets a RelationView's current record to the record with the specified record number.
Syntax public boolean goTo(int RecordNum) throws SQLException
public boolean goTo(String RecordNum) throws SQLException
Parameters RecordNum = An integer or String representing the ordinal number of the desired Record in the RelationView. If RecordNum is a String, it is assumed to be convertable to an integer.
Description Goes to a specific Record number in the view buffer referenced by the RelationView object and notifies all bound ProjLink and ListLink object of the change. This method facilitates random access of Records in a RelationView.

Returns: True indicates that a Record corresponding to the given record number was found. False otherwise.

See also ListLink
ProjLink
Record

Method: isBindingNotifyEnabled

Purpose Indicates whether or not binding notifications are enabled.
Syntax public boolean isBindingNotifyEnabled( ) throws SQLException
Parameters None.
Description Indicates whether ListLink, ProjLink, and RecordLink binding notifications are enabled (True) or disabled (False).

Method: isCurrentRecordReadable

Purpose Indicates whether or not a record can be read.
Syntax public boolean isCurrentRecordReadable( ) throws SQLException
Parameters None.
Description Indicates whether or not a record can be read.

Method: isCurrentRecordWritable

Purpose Indicates whether or not a record can be written to.
Syntax public boolean isCurrentRecordWritable( ) throws SQLException
Parameters None.
Description Indicates whether or not a record can be written to.

Method: next

Purpose Sets a RelationView's current record to the next record.
Syntax public boolean next( ) throws SQLException
Parameters None.
Description Moves the database cursor to the next Record in the view buffer and notifies all bound ProjLink and ListLink objects of the change.

Returns: True indicates that the next record was found. False indicates there were no more records.

See also ListLink
ProjLink
Record

Method: prev

Purpose Sets a RelationView's current record to the previous record.
Syntax public boolean prev( ) throws SQLException
Parameters None.
Description Moves the database cursor to the previous Record in the view buffer and notifies all bound ProjLink and ListLink objects of the change.

Returns: True indicates that the previous record was found. False indicates there is no previous record.

See also ListLink
ProjLink
Record

Method: processEmptyStringData

Purpose Processes an empty or NULL String.
Syntax public static String processEmptyStringData(String data,
RelationView rv,
int proj,
int columnType,
int treatBlankAsNull) throws SQLException
Parameters data = String to process.

rv = RelationView object.

proj = Projection ID for a column in a view traversing from left to right.

columnType = Column's data type.

treatBlankAsNull = Indicates whether or not to treat a blank as a NULL.

Description Processes an empty or NULL String. Returns the appropriate value to send to a database based on the columnType and treatBlankAsNull parameters.

Method: restartMultiView

Purpose Restarts a MultiView.
Syntax public void restartMultiView( ) throws SQLException
Parameters None.
Description A convenience function which calls the restart method on the containing MultiView. Called automatically after a successful saveMultiView. May also be used directly to pick up any database changes made by other applications.
See also restart
saveMultiView

Method: rewind

Purpose Rewinds a RelationView.
Syntax public void rewind( ) throws SQLException
Parameters None.
Description Resets a RelationView to its initial record state and notifies all bound ProjLink and ListLink objects of the change.
See also ListLink
ProjLink
Record

Method: saveMultiView

Purpose Saves a MultiView's changes.
Syntax public void saveMultiView( ) throws SQLException
Parameters None.
Description Saves all changes made to the containing MultiView object. This method saves all changes made by RelationView objects that refer to views in the scope of the containing MultiView object.
See also save
restartMultiview

Method: setName

Purpose Sets a RelationView's name.
Syntax public void setName(String newName) throws SQLException
Parameters newName = New name.
Description Sets the name associated with the RelationView in the MultiView object.

Method: sqlTypeConvert

Purpose Returns the int or String equivalent of a String or int data type name.
Syntax public static int sqlTypeConvert(String typename)
public static String sqlTypeConvert(int typeid)
Parameters typename = Data type name in a String.

typeid = Data type name in the form of a numerical value.

Description Returns the int or String equivalent of the input String or int data type name.

Method: unBindObj

Purpose Unbinds an object.
Syntax public void unBindObj(Object obj) throws SQLException
Parameters obj = Object to unbind.
Description Unbinds an object.

Method: unBindProj

Purpose Unbinds a projection.
Syntax public void unBindProj(int proj) throws SQLException
Parameters proj = Projection to unbind.
Description Unbinds a projection.

Method: undoRecord

Purpose Undoes a record's data changes.
Syntax public void undoRecord( ) throws SQLException
Parameters None.
Description Changes the current record to its original data values by doing the following:
  1. Undoing the data changes that have occurred since the record was retrieved from the database.
  2. Notifying bound ProjLink and ListLink objects that the record's data has changed.
See also ListLink
ProjLink

Constructor index | Method index | Top

Copyright © 1996 Symantec Corporation. All rights reserved.